home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
TASEXAM6.ARJ
/
BASE-HI.TAS
< prev
next >
Wrap
Text File
|
1992-03-20
|
4KB
|
154 lines
{
This script is geared toward investors who like to buy stocks at or near
new highs, as they emerge from basing patterns. It finds and graphs all
stocks which are making new highs, and all stocks which are within 5%
of their high AND have been in a narrow trading range for a period of time.
The graph of the stock appears on the screen and any base found is
defined with red lines. Stocks making new highs will not always show
base lines. The "base" shown in the legend on top of the price graph
tells how many days the stock has trading within 15%.
The volume graph plots the 50 day moving average and tells how today's
volume compares with the 50MA. The 5MA and 10MA comparisons are also
shown. The 5MA and 10MA calculations do not include today, rather they
end yesterday. They attempt to show how volume behaved immediately
prior to today's action.
Most data is displayed on the screen during processing, and it is saved
in the output file "BASE-NH.LST".
Written 3/18/92 by Tom Rategan. Prodigy PMGV10A
}
#max_quotes 255
#output_file 'BASE-NH.LST'
if first_ticker then begin
writeln(
' ********* New highs and possible near base breakouts. *********
');
writeln(
' All Time |--Base--|');
writeln(
' Name Close Change %OH High %Rng Days Vol %V'
);
writeln(
' ---- ----- ------ --- ---- ---- ---- --- --'
);
end;
if quote_count < 65 then return;
hiqc : array;
qc = (quote_count-2);
hiqc = hhv(c,qc);
if c < (hiqc*.95) then return;
hi30 : array;
lo30 : array;
hi30 = hhv(c,30);
lo30 = llv(c,30);
hi40 : array;
lo40 : array;
hi40 = hhv(c,40);
lo40 = llv(c,40);
hi60 : array;
lo60 : array;
hi60 = hhv(c,60);
lo60 = llv(c,60);
newhigh_switch = 0;
r30 = (1-(lo30/hi30))*100;
r40 = (1-(lo40/hi40))*100;
r60 = (1-(lo60/hi60))*100;
if r40 <= 5 then goto r40_less_5;
if r30 <= 5 then goto r30_less_5;
if r40 <= 10 then goto r40_less_10;
if r30 <= 10 then goto r30_less_10;
if r40 <= 15 then goto r40_less_15;
if r30 <= 15 then goto r30_less_15;
if r60 <= 20 then goto r60_less_20;
if r40 <= 20 then goto r40_less_20;
if r60 <= 25 then goto r60_less_25;
if r30 <= 20 then goto r30_less_20;
if c < hiqc then return else goto newhigh;
:r40_less_5
t = -39;
rng = r40;
goto count_days;
:r30_less_5
t = -30;
rng = r30;
goto count_days;
:r40_less_10
t = -39;
rng = r40;
goto count_days;
:r30_less_10
t = -30;
rng = r30;
goto count_days;
:r40_less_15
t = -39;
rng = r40;
goto count_days;
:r30_less_15
t = -30;
rng = r30;
goto count_days;
:r40_less_20
t = -39;
rng = r40;
goto count_days;
:r60_less_20
t = -59;
rng = r60;
goto count_days;
:r60_less_25
t = -59;
rng = r60
goto count_days;
:r30_less_20
t = -30;
rng = r30;
goto count_days;
:newhigh
newhigh_switch = 1;
t = 0;
rng = 15;
:count_days
gosub count;
if t = -(qc) then goto stats;
if ((1-(c[t]/hiqc))*100) > rng then goto stats else goto count_days;
:count
t = t-1;
return;
:stats
t= -(t+1);
hi_rng : array;
lo_rng : array;
hi_rng = hhv(c,t);
lo_rng = llv(c,t);
v50 : array;
v50 = mov(v,50,'s');
vv50 = ((v[0]/v50[0])*100);
v5 = (v[-1]+v[-2]+v[-3]+v[-4]+v[-5])/5;
v5v50 = ((v5/v50[0])*100);
v10 = (v[-1]+v[-2]+v[-3]+v[-4]+v[-5]+v[-6]+v[-7]+v[-8]+v[-9]+v[-10])/10;
v10v50 = ((v10/v50[0])*100);
oh = 100-((c/hiqc)*100);
chg = c[0]-c[-1];
opengraph(2);
sizegraph(4,2);
graph(1,' '+format(c[0],'$%5.2f')+' is '+format(oh,'%2.1f%')
+' off '+format(hiqc[0],'$%5.2f')+' high. Change= '+format(chg,'$%2.2f')
+' Base less than '+
format(rng,'%2.1f%')+' for '+format(t,'%2.f')+' days.');
if newhigh_switch = 1 then goto graphvol;
drawline(12,0,lo_rng[-1],0,lo_rng[-1],-t,-1);
drawline(12,0,hi_rng[-1],0,hi_rng[-1],-t,-1);
:graphvol
graph(v,'Today='+format(v[0],'%5.f')+' 50MA='+format(v50[0],'%5.f')
+' %Today='+format(vv50,'%4.f%')+' 5MA='+format(v5v50,'%4.f%')
+' of 50MA. 10MA='+format(v10v50,'%4.f%')+' of',v50,'50MA');
closegraph();
if newhigh_switch = 1 then goto write_nobase;
writeln(fullname,' ',c[0],' ',chg,int(oh),'%',hiqc,int(rng),'%',
int(t),' ',v[0],int(vv50),'%');
return;
:write_nobase
writeln(fullname,' ',c[0],' ',chg,int(oh),'%',hiqc,' No Base '
,v[0],int(vv50),'%');
return;